package com.itheima.controller;


import com.itheima.service.StatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/stat")
public class StatController {

    @Autowired
    private StatService statService;
    @GetMapping(value = "/columnCharts",name = "统计各部门人数，柱状图")
    public List<Map> columnCharts(){
        return  statService.columnCharts();
    }

    @GetMapping(value = "/lineCharts",name = "统计各部门人数，柱状图")
    public List<Map> lineCharts(){
        return  statService.lineCharts();
    }


    @GetMapping(value = "/pieCharts",name = "统计各部门人数，柱状图")
    public List<Map<String,Object>> pieCharts(){
        return  statService.pieCharts();
    }

    @GetMapping(value = "/pieECharts",name = "统计各部门人数，圆饼图")
    public Map<String,List<Map<String,Object>>> pieECharts(){
        return  statService.pieECharts();
    }
}
